@extends('simple-pc.views.layout')
@section('content')
    <link rel="stylesheet" href="/themes/simple-pc/static/css/product.css?v=1.1">
    <link rel="stylesheet" href="/static/libs/swiper-2.7.6/idangerous.swiper.css">
    <script src="/static/libs/swiper-2.7.6/idangerous.swiper.min.js"></script>
    <div class="banner" style="background-image: url('{{$product_info['category']['thumb']}}')">
    </div>
    <div class="product-header clearfix">
        <div class="product-header-l fl">
            <div class="swiper-container">
                <div class="swiper-wrapper">
                    @foreach ($product_info['images_url'] as $item)
                        <div class="swiper-slide">
                            <div class="swiper-slide-img" style="background-image: url('{{ $item }}')"></div>
                        </div>
                    @endforeach
                </div>
            </div>
        </div>
        <div class="product-header-r fr">
            <div class="product-header-r-name">{{$product_info['name']}}</div>
            <div class="product-header-r-original-price">原价:<span>{{$product_info['market_price']}}</span></div>
            <div class="product-header-r-price">现价:<span>{{$product_info['price']}}</span></div>
            <div>
                @foreach ($product_info['channel'] as $item)
                    <a href="{{$item->url}}" class="product-header-r-btn">
                        {{ $item->name }}
                    </a>
                @endforeach
            </div>
        </div>
    </div>
    <div class="product-main clearfix">
        <div class="product-main-hot fl">
            <div class="product-main-hot-header">
                热卖商品
            </div>
            <div class="product-main-hot-good">
                @foreach ($product_hot as $item)
                    <div class="hot-good-item">
                        <a href="/product/detail?id={{$item->id}}">
                            <div class="hot-good-item-img img-con">
                                <img src="{{ $item->thumb }}"/>
                            </div>
                            <div class="hot-good-item-name text-ellipsis">
                                {{ $item->name }}
                            </div>
                            <div class="hot-good-item-price">{{ $item->price }}</div>
                        </a>
                    </div>
                @endforeach
            </div>
        </div>
        <div class="product-desc fl">
            <div class="product-desc-header">
                商品详情
            </div>
            <div class="product-desc-text">
                {!! $product_info['description'] !!}
            </div>
        </div>
    </div>
    <script>
        $(function(){
            var mySwiper = $('.swiper-container').swiper({
                loop:true,
                autoplay:3000
                //其他设置
            });
        })
    </script>
@endsection
